<template>
  <div>
    <h3>最新的count值为:{{$store.state.count}}</h3>
    <button @click="btnHandler1">+1</button>
  </div>
</template>
<script>
import {mapMutations} from 'vuex'
var a = {...mapMutations(['add','addN'])}
console.log(a.add.toString())
console.log(a)
export default {
  data() {
    return {}
  },
  methods: {
    btnHandler1(){
      // this.$store.commit('add')
      // this.$store.commit('addN',3)
      setTimeout(()=>{this.addN(20)},1000)
      // console.log(1)
      // this.$store.dispatch('addAsync',20)
    },
    ...mapMutations(['add','addN'])
  }
}
</script>
<style lang='less' scoped>
</style>